import type { ProjectConfig } from '/@/types/config';
import { PROJ_CFG_KEY } from '/@/enums/cacheEnum';
import { getLocal } from '/@/utils/helper/persistent';
import projectConfig from '/@/settings/projectSetting';
import { deepMerge } from '/@/utils';
import { appStore } from '/@/store/modules/app';

export function initAppConfigStore() {
  let projCfg: ProjectConfig = getLocal(PROJ_CFG_KEY) as ProjectConfig;
  projCfg = deepMerge(projectConfig, projCfg || {});
  try {
  } catch {}
  appStore.commitProjectConfigState(projCfg);
}
